<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06_JS函数</title>
</head>
<body>
<script>
    function f1(){
        console.log('f1');
    }
    f1();
    f1();
    f1();

    function f2(n){
        console.log('f2');
        console.log(n);
    }
    f2(100);
    f2('hhhhh');

    function f3(n,m){
        console.log('f3');
        console.log(n+m)
    }
    f3(100,200);//300
    f3(200,100,300);//300 多余部分舍弃了
    f3(100)//缺少参数 100+undefined NaN
    f3('111'+111);


    function f4(x,y){
      console.log("f4");
      return x*y;
    }
    var r=f4(100,200);
    console.log(r);
    console.log(f4(100,200));

    //匿名函数
    var f5 = function (){
      console.log('f5');
    }
    f5();//调用函数
    console.log(f5);//保存了函数的全部内容，变量名充当了函数名
    console.log(typeof f5);//function

    const f6 = ()=>{
      console.log('f6');
    }
    f6();
    console.log(f6);
    console.log(typeof f6);

</script>
</body>
</html>